function showdevices() {
    var result = "";
    var tmp;
    if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {
        result = "这个浏览器不支持enumerateDevices接口";
    }
    navigator.mediaDevices.enumerateDevices().
        then(function (devices) {
            devices.forEach(function (device) {
                tmp= device.kind += ":" + device.label + " id=" + device.deviceId + "\n";
                result+=tmp
                //console.log('res:', result);
                //document.getElementById("devices").innerHTML = "sssss";
            });
            console.log(result);
            document.getElementById("devices").innerHTML = result;
        }).catch(function (err) {
            result = err.name + ": " + err.message;
        });
    //return result;

}
